package com.moshang.mall.search.controller;

import com.moshang.mall.search.service.SearchService;
import com.moshang.mall.search.vo.SearchParam;
import org.elasticsearch.action.search.SearchResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;

/**
 * @Author xww
 * @Description //TODO
 * @Date 2020/9/11   16:03
 **/
@Controller
public class SearchController {
    @Resource
    private SearchService searchService;
    @GetMapping("list.html")
    public String listPage(SearchParam param, Model model){
       SearchResponse result= searchService.search(param);
       model.addAttribute("result",result);
        return "list";
    }
}
